home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / sound / players / mp02_tar.z / mp02_tar / mp02 / adagio.h next >
Encoding:
C/C++ Source or Header  |  1993-02-05  |  1.4 KB  |  49 lines

  1. #define name_length 255
  2.  
  3. #define num_voices 16
  4. #define minpitch -12
  5. #define maxpitch 115
  6. #define NO_PITCH (maxpitch+1)
  7. #define minprogram 1
  8. #define maxprogram 128
  9.  
  10. struct note_struct {
  11.     long ndur;        /* duration */
  12.     char npitch;    /* pitch (middle C = 48) */
  13.     char nloud;        /* loudness (MIDI velocity) */
  14.     char nprogram;    /* adagio Z parameter (MIDI program) */
  15.     };
  16.  
  17. struct ctrl_struct {
  18.     unsigned char control;
  19.     unsigned char value;
  20.     };
  21.  
  22. typedef struct event_struct {
  23.     struct event_struct *next;
  24.     long ntime;        /* start time */
  25.     int nline;        /* line number from source code */
  26.     char nvoice;    /* adagio voice (MIDI Channel)
  27.              *  if this is a control change, high order 4 bits
  28.              *  contain the control number, otherwise high order
  29.              *  4 bits are 0 (see is_note macro below)
  30.              */
  31.     char ntrack;    /* source track, for interpreting midi files */
  32.     char ndest;        /* the external channel to send this note to */
  33.     union {
  34.     struct note_struct note;
  35.     struct ctrl_struct ctrl;
  36.     } u;
  37.     } *event_type;
  38.  
  39. #define nctrl 16
  40. #define ctrlsize (sizeof(struct event_struct) - \
  41.           sizeof(struct note_struct) + sizeof(struct ctrl_struct))
  42. #define ctrl_voice(c, v) (((c) << 4) + (v))
  43. #define vc_ctrl(v) ((v) >> 4)
  44. #define vc_voice(v) ((v) & 0x0F)
  45. #define is_note(n) (((n)->nvoice & 0xF0) == 0)
  46.  
  47. extern int program[num_voices];    /* midi program (timbre control) of note */
  48. #define PERCCHAN(v) (percsel&(1<<(v)))
  49.